﻿Imports System.Windows.Markup

Public Class MockServiceProvider
    Implements IServiceProvider

    Private m_provideValueTarget As MockProvideValueTarget
    Public Sub New(provideValueTarget As MockProvideValueTarget)
        m_provideValueTarget = provideValueTarget
    End Sub

    Public Function GetService(serviceType As Type) As Object Implements IServiceProvider.GetService
        Return m_provideValueTarget
    End Function
End Class

Public Class MockProvideValueTarget
    Implements IProvideValueTarget

    Private m_targetObject As Object
    Private m_targetProperty As Object

    Public Sub New(targetObject As Object, targetProperty As Object)
        m_targetObject = targetObject
        m_targetProperty = targetProperty
    End Sub

    Public ReadOnly Property TargetObject As Object Implements IProvideValueTarget.TargetObject
        Get
            Return m_targetObject
        End Get
    End Property

    Public ReadOnly Property TargetProperty As Object Implements IProvideValueTarget.TargetProperty
        Get
            Return m_targetProperty
        End Get
    End Property
End Class
